<template>
  <div class="barItem">
    <router-link :to="to">
      <div class="barItem-img">
        <slot name="icon"></slot>
      </div>
      <div class="barItem-lable">
        <slot></slot>
      </div>
    </router-link>
  </div>
</template>
<script>
  export default {
    name: "dh-tabbar-item",
    props: {
      to: {
        type: String,
        default: "#",
        require: true
      },
      src: {
        type: String,
        default: require("../../assets/logo.png"),
        require: true
      }
    },
    data() {
      return {
      }
    }
  };
</script>
<style lang="scss">
  $activeBg: #eee;
  $activeColor: #ffa91e;
  $color:#bb916a;
  .barItem {
    display: block;
    text-decoration: none;
    &.selected {
      a {
        background: $activeBg;
        i {
          color: $activeColor;
        }
        .barItem-lable {
          color: $activeColor;
        }
      }
    }
    a {
      padding: 7px 0;
      text-decoration: none;
      font-size: 12px;
      display: block;
      color: #bb916a;
      .barItem-img {
        i {
          font-size: 24px;
          display: block;
          margin-bottom: 5px;
        }
        img {
          width: 24px;
          height: 24px;
          display: block;
          margin: 0 auto 5px auto;
        }
      }
      .barItem-lable {
        line-height: 1;
      }
    }
  }
</style>


